win32 fallback: Add code to draw titlebars
authorBenjamin Otte <otte@redhat.com>
Sun, 21 Feb 2016 04:37:40 +0000 (05:37 +0100)
committerBenjamin Otte <otte@redhat.com>
Sun, 21 Feb 2016 19:44:36 +0000 (20:44 +0100)
gtk/gtkwin32draw.c

index 6c768d2fac2ea6c9758994a174f6a5840a47d5f1..ab2d8853bfaa561aa975dbe53b61398177e7bd05 100644 (file)
@@ -81,6 +81,19 @@ draw_radio (cairo_t *cr,
   cairo_stroke (cr);
 }
 
+static void
+draw_window (cairo_t *cr,
+             int      part,
+             int      state,
+             int      width,
+             int      height)
+{
+  gtk_cairo_set_source_sys_color (cr, state == 2 ? GTK_WIN32_SYS_COLOR_INACTIVECAPTION
+                                                 : GTK_WIN32_SYS_COLOR_ACTIVECAPTION);
+  cairo_rectangle (cr, 0, 0, width, height);
+  cairo_fill (cr);
+}
+
 typedef struct _GtkWin32ThemePart GtkWin32ThemePart;
 struct _GtkWin32ThemePart {
   const char *class_name;
@@ -97,7 +110,8 @@ struct _GtkWin32ThemePart {
 static GtkWin32ThemePart theme_parts[] = {
   { "button", 1,  0, { 3, 3, 3, 3 }, draw_button },
   { "button", 2, 13, { 0, 0, 0, 0 }, draw_radio },
-  { "button", 3, 13, { 0, 0, 0, 0 }, draw_check }
+  { "button", 3, 13, { 0, 0, 0, 0 }, draw_check },
+  { "window", 1,  0, { 0, 0, 0, 0 }, draw_window }
 };
 
 static const GtkWin32ThemePart *